<form #f="ngForm" class="addpatient_form">
  <div class="weui-cells addpatient_box">
    <div class="weui-cell">
      <div class="weui-cell__hd">
        <label class="weui-label">姓名</label>
      </div>
      <div class="weui-cell__bd">
        <input [(ngModel)]="name" #nameRef="ngModel" class="weui-input tex" type="text" name="姓名" placeholder="小名" readonly>
      </div>
    </div>
    <div class="weui-cell">
      <div class="weui-cell__hd">
        <label class="weui-label">身份证号</label>
      </div>
      <div class="weui-cell__bd">
        <input [(ngModel)]="ID" #idRef="ngModel" class="weui-input tex" type="tel" name="ID" placeholder="6541**********0041" weui-required
          readonly>
      </div>
    </div>
    <div class="weui-cell">
      <div class="weui-cell__hd">
        <label class="weui-label">手机号码</label>
      </div>
      <div class="weui-cell__bd">
        <input [(ngModel)]="mobile" #mobileRef="ngModel" class="weui-input content" type="tel" name="手机号码" placeholder="用于接收确认短信"
          weui-required minlength="11" maxlength="11" pattern="^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$">
      </div>
    </div>
    <div *ngIf="mobileRef.invalid && (mobileRef.dirty || mobileRef.touched)">
      <div class="toptips" *ngIf="mobileRef.errors?.pattern||mobileRef.errors?.minlength||mobileRef.errors?.maxlength">请输入正确的手机号码</div>
    </div>
    <div class="weui-cell">
      <div class="weui-cell__hd">
        <label class="weui-label">就诊卡号</label>
      </div>
      <div class="weui-cell__bd">
        <input [(ngModel)]="cardId" #cardRef="ngModel" class="weui-input content" type="tel" name="就诊卡号" placeholder="请输入就诊卡号" pattern="^[0-9]*$">
      </div>
    </div>
    <div *ngIf="cardRef.invalid && (cardRef.dirty || cardRef.touched)">
      <div class="toptips" *ngIf="cardRef.errors?.pattern">请输入正确的就诊卡号</div>
    </div>
    <div class="tips"><i class="weui-icon-warn weui-icon_msg"></i>姓名及身份证不支持重建，只能删除重建</div>
  </div>
  <div class="weui-btn-area btn">
    <button class="weui-btn weui-btn_primary" [disabled]="!f.form.valid || !f.form.dirty" [ngClass]="{'weui-btn_disabled': !f.form.valid || !f.form.dirty}"
      (click)="onShow('loading')">保存</button>
    <button class="weui-btn weui-btn_warn" (click)="onShow('loading')">删除</button>
  </div>
  <!-- <div class="footer">
    <div footer class="weui-footer">
      <p class="weui-footer__text">技术支持</p>
      <p class="weui-footer__text">©重庆钜元大数据有限公司</p>
    </div>
    <weui-toptips #toptips></weui-toptips>
  </div> -->
</form>
<weui-toast #success></weui-toast>
<weui-toast #loading [type]="'loading'"></weui-toast>